Go to Home Page
Questions?
Call 1-800-572-5517
 
  Go to Home Page  
  See all products
  See price schedules
  See manuals, tutorials, articles
  Download a free 30-day trial
  See user testimonials
  About Pacific Systems Group
 
 
SMF Tools
  See SMF Record Layouts
  See Sample SMF Reports
  Learn How to Export SMF Data
  Download Free SMF Reporting Software (30 days)
 
One of the greatest SMF record parsing programming languages I've ever seen. Chief, Large Systems Services Branch, NIH
  Choose Spectrum Writer to add 4GL to your product
  Report Writer Speedup Tips Article
Spectrum SMF Writer - the 4GL SMF Report Writer.

Add customized reports and PC export files to your product!

Table of Contents

NOTE: you can find this and other lessons in a
more complete and viewable format (including all Figures) in our Tutorial PDF.

Lesson 6. Improving the Appearance of your Report

  1. This lesson teaches you how to specify your own formatting options for a report. The formatting options discussed are:
  2. display formats (which determine how dates, times and numbers are formatted)
  3. column headings
  4. column widths
  5. the BIZ (blank if zero) parm
  6. the ACCUM / NOACCUM parms (for totalling or not totalling a column)
  7. Now that your report contains the data that you need, it is time to think about its appearance. Just because Spectrum SMF Writer can produce new reports quickly doesn't mean that the report has to look "quick and dirty" at all. This lesson lets you give your report that professional look, as if it were made with a custom report program.
Using Display Formats
  1. When it comes time for Spectrum SMF Writer to move raw data from the SMF record into the report line, it must decide exactly how to format the data. The format used is called the display format. Spectrum SMF Writer supports quite a number of different display formats, depending on the data type of the field. The following table contains a partial list of the more commonly used display formats. (A complete list can be found in .)
    1. Type of Data
    1. Display Format
    1. Description/Example
    1. Date
    1. MM-DD-YY
    1. 12/31/10
      (this is the default format for dates)
    1. MM-DD-YYYY
    1. 12/31/2010
    1. DD-MM-YYYY
    1. 31/12/2010
    1. SHORT1
    1. DEC 31, 2010
    1. SHORT2
    1. 31 DEC 2010
    1. SHORT3
    1. 31 DEC 10
    1. LONG1
    1. DECEMBER 31, 2010
    1. LONG2
    1. 31 DECEMBER 2010
    1. Time
    1. HH-MM-SS
    1. 13:59.59.123...
      (this is the default format for times)
    1. HH-MM
    1. 14:00 (time rounded to minutes)
    1. Numeric
    1. DOTSEP
    1. 1.234.567,98 (dots for thousands separator, comma for decimal digits)
    1. DISPLAY
    1. 0123M (no leading zero suppression, no commas, sign in zone nibble of last digit)
    1. PIC'ZZ9.9'
    1. User specified "picture", similar to COBOL's PIC
    1. DOLLAR
    1. $123.45 (with floating dollar sign)
    1. Any
    1. HEX
    1. 1234ABCD (shows raw data in hex format)
    1. BITS
    1. 00010011 (shows each bit in the raw data)
  2. When no display format has been specified by the user (as in most of the earlier examples in this tutorial), Spectrum SMF Writer uses a default display format. To specify your own format, just put the name of a display format in parentheses immediately after the field name in your control statement. (Do not leave a space between the field name and the open parenthesis.) Display formats are allowed in COLUMNS , TITLE and other statements that produce report output.
  3. For example:

TITLE: 'DAILY SMF ABSTRACT FOR' #DATE(LONG1)
COLUMNS: SMF30DTE(SHORT3) SMF30TME(HH-MM) EXCP-CHARGE(DOLLAR) SMF30SCC(HEX)

  1. The display formats within parentheses after the field names above specify how the fields will be formatted in the report.
  2. Figure _ shows a report that uses display formats.
  3. Customizing a report by using display formats, column headings, override widths and more
    Customizing a report by using display formats, column headings, override widths and more
Specifying Column Headings
  1. Another way to improve your report is by providing your own column headings. You remember that Spectrum SMF Writer uses the field name itself as the default column heading. (And most field names in the SMF files are not exactly self-explanatory.)
  2. To specify your own column heading, just place the desired heading text in parentheses after the field name in the COLUMNS statement. To break your column heading text into multiple lines, use a vertical bar (|) as the separator character. For example:

COLUMNS: SMF30BLK('EXCP|BLOCK|COUNT')

  1. In the above statement, we specified our own column heading for the SMF30BLK field. As you can see in the report in Figure _, the SMF30BLK column now has EXCP, BLOCK , and COUNT stacked over it as a 3-line column heading.
Specifying a Column's Width
  1. You can also specify the exact number of bytes to use for a particular column in your report.
  2. When no column width is specified, Spectrum SMF Writer chooses a default column width. You may want a larger column width (to hold big numeric values, for example). Or you may want a smaller column width (perhaps to truncate a long character field so that you can squeeze more columns into your report).
  3. Just specify the number of bytes you want for a particular column in parentheses after the field name. For example:

COLUMNS: SMF14_JFCBDSN(20)

  1. The above statement tells Spectrum SMF Writer to shorten the long 44-byte DSN field to just the first 20 bytes, to save space in the report.
The Blank-If-Zero Parm
  1. Many SMF reports are written to search out exceptional situations. To help make unusual values stand out in a report, it is often help to show blanks for all 0 values. (Especially when the 0 value is 11 bytes long, like a 00:00:00.00 time interval which can really clutter a report.) To do that, specify the BIZ parm in parentheses after the field name. For example:

COLUMNS: SMF30BLK('EXCP|BLOCK|COUNT' BIZ 6)

  1. The report in Figure _ uses the BIZ parm shown above. The report lines with a zero EXCP count now have blanks in that column, allowing the non-zero values to stand out.
  2. in the example statement above we also specified override column headings and an override width. This illustrates the fact that you can specify more than one override for a single field. Their order within the parentheses is not important. You can separate the overrides with spaces and/or commas.
Which Columns Are Totalled?
  1. You can also specify exactly which columns receive totals in your report. By default, all numeric fields are totalled. However, this is obviously not desirable for certain numeric fields (such as LRECL , record type, etc.) To suppress totals for a particular numeric column, specify the NOACCUM parm for that field. That tells Spectrum SMF Writer not to "accumulate" it for printing in statistic lines, of which the total line is the most common. (Some other statistic lines available are MAX , MIN , AVG , and STDDEV . The NOACCUM parm also applies to all of these).
  2. You can also specify ACCUM to force a column to be totalled. A common example of the need for this is with fields that contain time intervals (as opposed to time-of-day values). By default, Spectrum SMF Writer does not print totals for any time field. Just specify an ACCUM parm for any time fields that you want totals for.

COLUMNS: SMF14LRECL(NOACCUM) SMF14RTY(NOACCUM)
COLUMNS: SMF30TCN('TOTAL|DEVICE|CONNECT|TIME', ACCUM)

 
  • to avoid having to specify ACCUM and NOACCUM parms in every report you make, consider adding the appropriate parm to the definitions of commonly used fields in your copy library. Just locate the FIELD statement you want, and add either an ACCUM or NOACCUM parm to the statement. For example:

FIELD: SMF30TCN DISP(18) LEN(4) TYPE(BU-SECS) ACCUM /* ALWAYS TOTAL */

Formatting Features for International Customers
  1. Here are some formatting tips of special interest to our international customers.
  2. You may want to change the default way in which dates and numbers are formatted (rather than specifying it for every individual field in the report). The FORMAT option lets you do this easily. Put the following statement near the beginning of your control statements.

OPTIONS: FORMAT(DD-MM-YY, DOTSEP)

  1. This statement makes DD-MM-YY the default format for all dates in the report. And it makes the DOTSEP format the default for all numeric fields.
  2. You can also change the delimiter that Spectrum SMF Writer uses when it formats dates and time in the report. For example:

OPTIONS: DATEDELIM('-') TIMEDELIM('.')

  1. The statement above would cause dates to be formatted like this: 31-12-10 . And time fields would look like this: 12.34.56 . Of course, you can use the delimiter character of your choice.
  2. And don't forget this option that was mentioned in an earlier lesson:

OPTION: DDMMYYLIT

  1. This option lets you use DD/MM/YY format date literals when writing your control statements. Note that the delimiters specified by the DATEDELIM and TIMEDELIM options apply only to formatting data to display in the report. The delimiters used to write date and time literals (in the control statements) can not be changed. Always use slashes for dates and colons for times in your literals.
  2. You can put all of these options on a single OPTION statement, of course. An easy way to specify these options for all reports is to put them in a new member of your Spectrum SMF Writer copy library. Then either copy that member each time with a COPY statement, or add a SWOPTION DD in your execution JCL to copy them automatically.
Summary
  1. Here is a summary of what we learned in this lesson:
  2. use an override display format to change the way data is formatted in a report
  3. use override column headings to change the column headings in a report
  4. specify a column width to change the width of a column in a report
  5. use the BIZ parm to blank out zero values
  6. use the ACCUM or NOACCUM parms to specify which columns to show totals for
  7. each of these overrides should be put in parentheses after the appropriate field name
  8. you can specify multiple overrides for a field, all within the same parentheses
  9. use the FORMAT option to change the default display format for all fields in a report
  10. several options exist to help format reports using international conventions
  11. The next lesson will teach you how to create your own new fields to use in your report.
To Learn More
  1. You can also learn:
  2. how to left-justify, center or right-justify data within its column ()
  3. how to blank out repeating values in a column()
  4. how to change the spacing between columns in a report ()
  5. the complete syntax for the COLUMNS statement, in .
NEXT LESSON: How to Create Your Own Fields

Spectrum SMF Writer - the 4GL SMF Report Writer.

Copyright 2024.
Pacific Systems Group.
All rights reserved.
Home | Products | Prices | Documentation | 30-Day Trials | Customer Reviews | Company | FAQ | Sample Reports | SMF Records
Send Your Comments or Questions